const req = require('./api.js');

const {apiUrl} = getApp().globalData;
// 个人信息
export const UsersInfo = (api_token) => req(apiUrl + '/api/users/info', {
    p: 't',
    api_token,
}, {loading: {show: false}})

// .保存观众信息
export const UsersSave = (api_token, avatar, uaddress, position, uprovince, ucity, uarea, work) => req(apiUrl + '/api/users/save', {
    p: "t",
    api_token,
    avatar,
    uaddress,
    position,
    uprovince,
    ucity,
    uarea,
    work,
}, {
    method: "POST",
    loading: {show: false}
});
// .保存公司信息
export const UsersSaveCompany = (api_token, company, label, shichang, area, country, province, city, address, cate, grade, name0, mobile0, phone0, name1, mobile1, phone1, name2, mobile2, phone2, name3, mobile3, phone3,) => req(apiUrl + '/api/users/savecompany', {
    p: "t",
    api_token,
    company,
    label,
    shichang,
    area,
    country,
    province,
    city,
    address,
    cate,
    grade,
    name0,
    mobile0,
    phone0,
    name1,
    mobile1,
    phone1,
    name2,
    mobile2,
    phone2,
    name3,
    mobile3,
    phone3,
}, {
    method: "POST",
    loading: {show: false}
});

// 上传头像文件（展示接口，并不实际调用）
export const UsersAvatar = (api_token, avatar) => req(apiUrl + '/api/users/avatar', {
    p: 't',
    api_token,
    avatar,
}, {method: "POST", loading: {show: false}})
// 我的足迹.
export const MyLooked = (api_token, skip, take, language = 1) => req(apiUrl + '/api/my_looked', {
    p: 't',
    api_token,
    skip,
    take,
    language
}, {loading: {show: false}})
// 意见反馈
// /feedback/feedback_save
export const FeedbackSave = (api_token, content) => req(apiUrl + '/api/feedback/feedback_save', {
    p: 't',
    api_token,
    content,
}, {method: "POST", loading: {show: false}});
export const ShiChang = () => req(apiUrl + '/api/home/shichang', {
    p: 't',
}, {loading: {show: false}})
export const Country = () => req(apiUrl + '/api/home/country', {
    p: 't',
}, {loading: {show: false}});

export const Province = () => req(apiUrl + '/api/home/province', {
    p: 't',
}, {loading: {show: false}});
export const ServiceIndex = () => req(apiUrl + '/api/service/index', {
    p: 't',
}, {loading: {show: false}});
export const ServicePoint = (service_name) => req(apiUrl + '/api/service/point', {
    p: 't',
    service_name
}, {loading: {show: false}});
